<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>宝宝列表</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../../css/mui.min.css" rel="stylesheet" />
		
		<style>
			
			body {
				overflow: hidden !important;
				background: #fff!important;
			}
			
			.father {
				width: 100%;
				text-align: center;
				color: #7d7c7c;
				padding: 0 20%;
				margin-top: 20px;
			}
			
			.father>span {
				text-align: center;
				display: inline-block;
				width: 25%;
				position: relative;
			}
			
			.father span img {
				width: 100%;
				display: inline-block;
				padding-bottom: 10px;
			}
			
			.state {
				border: solid 1px #fd5c65;
				border-radius: 10px;
				position: absolute;
				padding: 0 5px;
				font-size: 10px;
				background: #fff;
				height: 15px;
				line-height: 15px;
				color: #fd5c65;
				top: 46%;
				left: 0;
				width: 100%;
			}
			
			.fathersfather {
				width: 100%;
				margin: 0 10%;
				margin-top: 10px;
			}
			
			.fathersfather span {
				float: left;
				width: 16%;
				margin-right: 5%;
				text-align: center;
				position: relative;
			}
			
			.fathersfather span img {
				width: 100%;
				padding-bottom: 10px;
			}
			
			.tianjai {
				border-radius: 10px;
				position: absolute;
				padding: 0 5px;
				font-size: 10px;
				background: #fd5c65;
				height: 15px;
				line-height: 15px;
				color: #fff;
				top: 47%;
				left: 0;
				width: 100%;
			}
			
			.invite {
				overflow: hidden;
				background: #fff;
				
				
			}
			
			.invitetypebtn {
				width: 100%;
				padding: 0 10%;
			}
			
			#weixininvite {
				text-align: center;
				background: #32cd45;
				height: 40px;
				color: #fff;
				line-height: 40px;
				border-radius: 20px;
				margin: 10px 0 15px 0;
			}
			
			#telinvite {
				text-align: center;
				color: #50addb;
			}
			
			.gongxian {
				margin: 0 20px;
			}
			
			.gongxian .title {
				padding: 10px 0 10px 10px;
				font-size: 16px;
			}
			
			.ul1 li {
				line-height: 40px;
			}
			
			.ul2 li span {
				border: solid 1px #00a0e9;
				border-radius: 20px;
				color: #00a0e9;
				padding: 5px 10px;
			}
			
			.ul2 .mui-pull-right {
				margin-top: 12px;
			}
			
			#weixinBox {
				position: fixed;
				width: 100%;
				height: 100%;
				background: rgba(0, 0, 0, .5);
				top: 0;
				left: 0;
				text-align: center;
				display: none;
			}
			
			.weixinBoxContent {
				width: 100%;
				background: #fff;
				border-top-left-radius: 20px;
				border-top-right-radius: 20px;
				z-index: 9999;
				position: absolute;
				bottom: 0;
				padding: 20px 0px 0 0px;
			}
			
			#weixinBox img {
				display: inline-block;
				width: 1.5rem;
				padding: 10px 0;
			}
			
			.weixinBoxContent .tel {
				position: absolute;
				right: 10px;
				margin-top: -40px;
				color: #1bb7fd;
				font-size: 14px;
			}
			
			.weixinBoxContent .content {
				padding: 0 10px;
			}
			
			.cancel {
				border-top: solid 1px #dfdfdf;
				height: 50px;
				line-height: 50px;
			}
			.mui-radio{
				padding-bottom: 10px ;
				border-bottom: solid 1px #dfdfdf;
				padding-left: 10px;
				padding-top: 10px;
			}
			.mui-radio img{
				width: 50px;
				height: 50px;
				border-radius: 100px;
				float: left;
				margin-right: 10px;
			}
			.mui-radio label{
				padding: 0;
				height: 50px;
				line-height: 50px;
				font-size: 14px;
			}
			.mui-radio label .bind{
				
				border-radius: 10px;
				width: 60px;
				display: inline-block;
				height: 20px;
				line-height: 20px;
				text-align: center;
				margin-left: 20px;
				color: #7B7B7B;
			}
			.mui-radio input[type='radio'], .mui-checkbox input[type='checkbox']{
				top: 25px;
				color:#fd5c65;
				width: 20px;
				height: 20px;
				
			}
			.mui-radio input[type=radio]:checked:before {content: '\e442';color:#fd5c65;} 
			.mui-radio input[type='radio']:before{
				font-size: 20px;
			}
			.green{ 
				border: solid 1px #32cd45!important;
			}
			.red{
				border: solid 1px #fd5c65;
			}
		
			
			.mui-radio input[type=radio]:checked:before {content: '\e442';color:#fd5c65;} 
			
		</style>
	</head>

	<body>
		<div id="childList">
			<div class="mui-input-row mui-radio" v-for="item in items" >
				<label @tap="changechild(item)">
					<img :src="item.child_avatar" />
					<span>{{item.child_name}}<span style="padding-left: 20px;">生日{{item.day}}</span></span>
					<input class="radio" value="Item1" name="radio1" type="radio" :checked="childid==item.child_id">
				</label>
			</div>
			
		</div>
		<script src="../../../js/mui.js"></script>
		<script src="../../../js/app.js"></script>
		<script src="../../../js/vue.min.js"></script>
		<script src="../../../js/token.js"></script>
		<script type="text/javascript">
			mui.init()
			mui.plusReady(function(){
			 	state=app.getState();
				var memberToken=state.memberToken;
				var uid=state.userid;
				var childid = state.childid
				childList.childid=childid;
				
				mui.post(Apiurl+'index/children',{
					uid:uid,
					memberToken:memberToken
				},function(data){
					console.log(JSON.stringify(data));
					childList.items = data.list
				},"json")
			})
			var childList = new Vue({
				el: '#childList',
				data:{
					items:[],
					childid:''
				}, 
				methods:{  
					changechild: function(item){ 
						
						state.childid = item.child_id
						localStorage.setItem('$state',JSON.stringify(state))
						var momentsrefresh = plus.webview.getWebviewById("momentsrefresh"); //根据页面ID获取到该页面对象
						momentsrefresh.reload(true); //设置页面重新加载项(默认为false，改为true)
						var monitor = plus.webview.getWebviewById("monitor"); //根据页面ID获取到该页面对象
						monitor.reload(true); //设置页面重新加载项(默认为false，改为true)
						var pcenter = plus.webview.getWebviewById("pcenter"); //根据页面ID获取到该页面对象
						pcenter.reload(true); //设置页面重新加载项(默认为false，改为true)
						
						/*mui.fire(plus.webview.getWebviewById('userinfoindex'),"changeChild",{ 
							changeChild : item.child_id
						})
						
						mui.fire(plus.webview.getWebviewById('activityrefresh'),"changeChild",{ 
							changeChild : item.child_id
						}) 
						mui.fire(plus.webview.getWebviewById('noticerefresh'),"changeChild",{ 
							changeChild : item.child_id
						}) 
						mui.fire(plus.webview.getWebviewById('reciperefresh'),"changeChild",{ 
							changeChild : item.child_id
						})
						mui.fire(plus.webview.getWebviewById('schedulerefresh'),"changeChild",{ 
							changeChild : item.child_id
						}) 
						mui.fire(plus.webview.getWebviewById('pcenter'),"changeChild",{ 
							changeChild : item.child_id
						}) 
						mui.fire(plus.webview.getWebviewById('integralrefresh'),"changeChild",{ 
							changeChild : item.child_id
						}) 
						mui.fire(plus.webview.getWebviewById('monitor'),"changeChild",{ 
							changeChild : item.child_id
						}) 
						mui.fire(plus.webview.getWebviewById('myschool'),"changeChild",{ 
							changeChild : item.child_id
						}) 
						mui.fire(plus.webview.getWebviewById('invite'),"changeChild",{ 
							changeChild : item.child_id
						}) 
						mui.fire(plus.webview.getWebviewById('register'),"changeChild",{ 
							changeChild : item.child_id 
						}) */
						
						
					}
				}
			})
			 //处理返回键
        var backButtonPress = 0;
        mui.back = function(event) {
            var ws = plus.webview.currentWebview()
            if (ws) {
                ws.close();
            } else {
                backButtonPress++;
                if (backButtonPress > 1) {
                    plus.runtime.quit();
                } else {
                    plus.nativeUI.toast('再按一次退出应用');
                }
                setTimeout(function() {
                    backButtonPress = 0;
                }, 1000);
                return false;
            }
        };
		</script>
	</body>

</html>